﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;

namespace SeniorEventTest
{
    class Player
    {
        public event EventHandler OnAttack =null;
        public void DoAOE()
        {
            if(OnAttack != null) OnAttack(this, EventArgs.Empty);
        }
    }

    class Enemy
    {
        public void AttackMe(object sender,EventArgs args)
        {
            Console.WriteLine("我被攻击了！！");
        }
    }

    internal class Program
    {
        static void Main(string[] args)
        {
            Player player = new Player();
            Enemy enemy = new Enemy();
            player.OnAttack += enemy.AttackMe;
            player.DoAOE();
        }
    }
}
